home *** CD-ROM | disk | FTP | other *** search
Java Source | 1996-12-07 | 1.4 KB | 59 lines |
- /*
- A basic extension of the java.applet.Applet class
- */
-
- import java.awt.*;
- import java.applet.*;
-
- public class Calculate extends Applet {
- void LoanCalcButton_Clicked(Event event) {
- //{{CONNECTION
- // Create and show the Frame
- (new LoanCalc()).show();
- //}}
- }
-
- void SimpleCalcButton_Clicked(Event event) {
- //{{CONNECTION
- // Create and show the Frame
- (new CalculateFrame()).show();
- //}}
- }
-
-
- public void init() {
- super.init();
-
- //{{INIT_CONTROLS
- setLayout(null);
- addNotify();
- resize(284,153);
- label1 = new java.awt.Label("Welcome to the Calculation Applet!",Label.CENTER);
- label1.reshape(18,18,234,18);
- add(label1);
- SimpleCalcButton = new java.awt.Button("Simple Calculations");
- SimpleCalcButton.reshape(66,54,144,24);
- add(SimpleCalcButton);
- LoanCalcButton = new java.awt.Button("Loan Calculations");
- LoanCalcButton.reshape(66,90,144,24);
- add(LoanCalcButton);
- //}}
- }
-
- public boolean handleEvent(Event event) {
- if (event.target == SimpleCalcButton && event.id == Event.ACTION_EVENT) {
- SimpleCalcButton_Clicked(event);
- }
- if (event.target == LoanCalcButton && event.id == Event.ACTION_EVENT) {
- LoanCalcButton_Clicked(event);
- }
- return super.handleEvent(event);
- }
-
- //{{DECLARE_CONTROLS
- java.awt.Label label1;
- java.awt.Button SimpleCalcButton;
- java.awt.Button LoanCalcButton;
- //}}
- }
-